<template>
    <div>
        <h1>这是App组件</h1>

        <mt-button type="default" @click="show">默认按钮</mt-button>

        <mt-button plain>plain</mt-button>



        <button type="button" class="mui-btn mui-btn-warning">
            黄色
        </button>

        <router-link to="/account">Account</router-link>
        <router-link to="/goodslist">GoodsList</router-link>

        <router-view></router-view>
    </div>
</template>

<script>
    // 导入toast组件
    import {Toast} from 'mint-ui'

    export default {
        name: "App",
        data() {
            return {
                instance: null
            }
        },
        created(){
          this.getList();
        },
        methods: {
            getList(){
                this.show();
                setTimeout(() => {
                this.instance.close()
              }, 3000)
            },
            show() {
               this.instance =  Toast({
                    message: '提示消息',
                    position: 'top',
                    duration: -1, // 如果是-1，则弹出之后不消失
                    iconClass: 'glyphicon glyphicon-heart',
                    className: 'icon' // 自定义Toast的样式，需要自己提供一个类名
                })
            }
        }
    }
</script>

<style scoped>

</style>